package channelService

import (
	"gitee.com/fierce_wolf/go-fox-edge-channel-common/channelAPI"
)

var (
	service        *channelService
	execute        *executeService
	opcUaConnector OpcUaConnector
)

// 备注：GO必须要有外部的显式调用的时候，才会执行init()，比如声明下面的外部函数Initialized()
func init() {
	service = &channelService{}
	execute = &executeService{}
}

func BindChannelAPI() {
	// 告知框架：实现了下面这几个接口
	channelAPI.Service.IOpenChannel = service
	channelAPI.Service.ICloseChannel = service
	channelAPI.Service.IExecute = service
}

func Initialized() {
	go opcUaConnector.Scheduler()
}
